Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoconf: Fortran-netCDF C compatibility test #229

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

marshallward
Copy link
Member

This patch introduces a new autoconf macro, AX_FC_CHECK_C_LIB, which confirms if the Fortran compiler can be linked to the netCDF C library. As with other netCDF tests, the nc-config tool is used if necessary (and available).

This resolves some recent issues on platforms where netCDF and netCDF-Fortran are installed in separate locations, with different library directories (-L).

It also resolves some false assumptions in configure.ac which presumed equivalent access by the configured C and Fortran compilers. Previously, we would test if the C compiler could be linked to netCDF, and then assume that the Fortran compiler shared the same relationship. We now use the Fortran compiler for both C and Fortran tests.

This patch fixes many issues observed on MacOS systems, including some persistent problems on the GitHub Actions MacOS tests. For example, we can now use the default GCC 12 compilers, rather than forcing a rollback to GCC 11.

This patch introduces a new autoconf macro, AX_FC_CHECK_C_LIB, which
confirms if the Fortran compiler can be linked to the netCDF C library.
As with other netCDF tests, the nc-config tool is used if necessary (and
available).

This resolves some recent issues on platforms where netCDF and
netCDF-Fortran are installed in separate locations, with different
library directories (-L).

It also resolves some false assumptions in configure.ac which presumed
equivalent access by the configured C and Fortran compilers.
Previously, we would test if the C compiler could be linked to netCDF,
and then assume that the Fortran compiler shared the same relationship.
We now use the Fortran compiler for both C and Fortran tests.

This patch fixes many issues observed on MacOS systems, including some
persistent problems on the GitHub Actions MacOS tests.  For example, we
can now use the default GCC 12 compilers, rather than forcing a rollback
to GCC 11.
@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #229 (be9c73d) into dev/gfdl (e26d8da) will increase coverage by 1.29%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           dev/gfdl     #229      +/-   ##
============================================
+ Coverage     35.93%   37.23%   +1.29%     
============================================
  Files           260      263       +3     
  Lines         72002    73060    +1058     
  Branches      13590    13605      +15     
============================================
+ Hits          25872    27201    +1329     
+ Misses        41072    40841     -231     
+ Partials       5058     5018      -40     
Impacted Files Coverage Δ
...ig_src/drivers/unit_tests/MOM_unit_test_driver.F90 92.00% <0.00%> (ø)
src/framework/MOM_unit_testing.F90 74.66% <0.00%> (ø)
src/framework/testing/MOM_file_parser_tests.F90 94.15% <0.00%> (ø)
src/framework/MOM_string_functions.F90 86.82% <0.00%> (+0.97%) ⬆️
config_src/infra/FMS1/MOM_coms_infra.F90 62.32% <0.00%> (+2.73%) ⬆️
config_src/infra/FMS1/MOM_error_infra.F90 100.00% <0.00%> (+7.69%) ⬆️
src/framework/MOM_document.F90 72.76% <0.00%> (+11.83%) ⬆️
src/framework/MOM_error_handler.F90 59.77% <0.00%> (+20.68%) ⬆️
src/framework/MOM_file_parser.F90 90.78% <0.00%> (+30.58%) ⬆️
src/framework/posix.F90 50.00% <0.00%> (+50.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marshallward
Copy link
Member Author

marshallward commented Nov 3, 2022

Since this PR fixes an issue in the MacOS CI test, the failure of the (currently broken) MacOS build in its regression test is expected.

@adcroft adcroft merged commit d46de87 into NOAA-GFDL:dev/gfdl Nov 7, 2022
@marshallward marshallward deleted the ci_bindc_test branch November 8, 2022 23:02
marshallward pushed a commit that referenced this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants